<?php $url = new Zend_Controller_Action_Helper_Url();?>
<?php $this->nav = "<a href=\"".$url->simple('','')."\">首页</a> > <a href=\"".$url->simple('','student')."\">共同学习</a> > <a href=\"".$url->simple('','student')."\">学生学习</a> > 专题学习"?>

<?php if ($this->isCurrentTopic):?>
<div id="currenttopic_title">
	<div style="float:right; margin-top:6px;">&gt;&gt;&nbsp;&nbsp;
	<a href="<?= $url->simple('listtopic', 'student', null);?>">历史专题</a>
	&nbsp;&nbsp;&nbsp;Previous Themes</div>
</div>
<?php else :?> 
 <div id="lishitopic_title">
	<div style="float:right; margin-top:6px;">&gt;&gt;&nbsp;&nbsp;
	<a href="<?= $url->simple('listtopic', 'student', null);?>">历史专题</a>
	&nbsp;&nbsp;&nbsp;Previous Themes</div>
</div>
<?php endif;?>

<div id="currenttopic_backup">
	<table width="95%" style="margin: 0 15px;">
		<tr>
			<td height="26">
				<h4><?= $this->currentTopic->title; ?></h4>
			</td>
		</tr>
		<tr><td align="left"><?= $this->currentTopic->content; ?></td></tr>
	</table>
</div>

<div id="zhuantixuexi_title">
	<div style="float:right; margin-top:6px;">&gt;&gt;&nbsp;&nbsp;
	<a href="<?= $url->simple('publish', 'student', null);?>">我要发表</a>
	&nbsp;&nbsp;&nbsp;Submit</div>
</div>

<div id="zhuantixuexi_backup">
	<div class="w-listp">
		
        <div class="clearfix">
        
        <table width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
        	<tbody>
        		<tr>
				<td><table cellspacing="0" cellpadding="0" border="0" align="left">
                   	<tbody><tr>
                   	<td align="center">
               			<div id="d1" onclick="showCustomer('xuexiaolist/topicId/<?= $this->currentTopic->id; ?>/type/s' , this);" 
               				class="<?php if ($this->type == 's'):?>bbb<?php else :?>aaa<?php endif;?>"></div>
            			<div id="d2" class="<?php if ($this->type == 'n'):?>ddd<?php else :?>ccc<?php endif;?>" onclick="showCustomer('guojialist/topicId/<?= $this->currentTopic->id; ?>/type/n' , this);"></div>
            			<div id="d3" class="<?php if ($this->type == 'f'):?>fff<?php else :?>eee<?php endif;?>" onclick="showCustomer('shijielist/topicId/<?= $this->currentTopic->id; ?>/type/f' , this);"></div>
                    </td>
                    </tr></tbody>
                   	</table></td>
				</tr>
        	</tbody>
        </table>
        	<div id="moddel">
        	<table width="590" cellpadding="0" cellspacing="0">
        	<tr height="40" >
        		<td width="9" align="center"></td>
        		<td width="25" align="center"></td>
        		<td width="409" align="center"><h4>标题</h4>Topics</td>
        		<td width="100" align="center"><h4>点击</h4>Traffic Volume</td>
        		<td width="70" align="center"><h4>更新日期</h4>Updated on</td>
        		<td width="9"></td>
        	</tr>
        	<?php $i = 1;?>
			<? foreach($this->currentContents as $content):  ?>
        		<tr  height="26" >
        			<td width="9" <?php if ($i%2):?>background="/skins/blues/images/gongtong/circular_l_1.gif"<?php endif;?>></td>
        			<td width="25" align="center" align="center" <?php if ($i%2):?>bgcolor="#ecf2f8"<?php endif;?>>◇</td>
        			<td width="409" align="left" <?php if ($i%2):?>bgcolor="#ecf2f8"<?php endif;?>  >
            			<?php if ($content->top):?><font color="#FF0000">[置顶]</font><?php endif;?>
            			<a href="<?=$this->url(array('contentId' => $content->id), 'student_content'); ?>">
		    			<?=$this->Escape($content->title); ?></a>
        			</td>
        			<td width="100" align="center" <?php if ($i%2):?>bgcolor="#ecf2f8"<?php endif;?>>
        				<?=$this->Escape($content->views); ?>
        			</td>
        			<td width="70" align="center" <?php if ($i%2):?>bgcolor="#ecf2f8"<?php endif;?>>
        				<? $date = new Zend_Date($content->updatetime, Zend_Date::TIMESTAMP); ?>
        				<?= $date->toString("Y-M-d");?>
        			</td>
        			<td width="9" <?php if ($i%2):?>background="/skins/blues/images/gongtong/circular_r_1.gif"<?php endif;?>></td>
        		</tr>
       		<?php $this->topicId = $content->topicid;?>
       		<?php $this->type = $content->type;?>
        	<?php $i++;?>
       		<? endforeach; ?>
        	</table>
        	<div style="width:400px; margin-left:80px;">
        <?if ($this->currentContents instanceof Zend_Paginator): ?>
			<?= $this->paginationControl($this->currentContents, 'sliding', 'student/_paginator.phtml', array('topicId'=>$this->topicId,'type'=>$this->type))?>
		<?endif?>
        </div>
        	</div>
        </div>
    </div>	
</div>


<script type="text/javascript">
var xmlHttp
function GetXmlHttpObject(handler){ 
	var objXmlHttp=null;
	if (navigator.userAgent.indexOf("Opera")>=0){
		alert("This example doesn't work in Opera");
		return; 
	}
	if (navigator.userAgent.indexOf("MSIE")>=0){ 
		var strName="Msxml2.XMLHTTP";
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0){
			strName="Microsoft.XMLHTTP";
		} 
		try{ 
			objXmlHttp=new ActiveXObject(strName);
			objXmlHttp.onreadystatechange=handler;
			return objXmlHttp;
		}catch(e){ 
			alert("Error. Scripting for ActiveX might be disabled");
			return;
		} 
	} 
	if (navigator.userAgent.indexOf("Mozilla")>=0){
		objXmlHttp=new XMLHttpRequest();
		objXmlHttp.onload=handler;
		objXmlHttp.onerror=handler; 
		return objXmlHttp;
	}
} 
</script>

<script type="text/JavaScript">
function showCustomer(str , obj){
	var d1 = document.getElementById("d1");
	var d2 = document.getElementById("d2");
	var d3 = document.getElementById("d3");
	if(d1 == obj){
		d1.className = "bbb";
		d2.className = "ccc";
		d3.className = "eee";
	}
	if(d2 == obj){
		d1.className = "aaa";
		d2.className = "ddd";
		d3.className = "eee";
	}

	if(d3 == obj){
		d1.className = "aaa";
		d2.className = "ccc";
		d3.className = "fff";
	}
	
	var url="/student/" + str;
		//alert(url)
	xmlHttp=GetXmlHttpObject(stateChanged)
	xmlHttp.open("GET", url , true);
	xmlHttp.setRequestHeader("If-Modified-Since","0"); 
	xmlHttp.send(null);
	
} 

function stateChanged(){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
		var result = xmlHttp.responseText;
		var classObj = document.getElementById("moddel");
		classObj.innerHTML = result;
	} 
}
</script>